   
    <script>

      jQuery(document).ready(function($) {

      $('.theme-login').click(function(){

        $('.theme-popover-mask').fadeIn(100);

        $('.theme-popover').slideDown(200);

      })

      $('.theme-poptit .close').click(function(){

        $('.theme-popover-mask').fadeOut(100);

        $('.theme-popover').slideUp(200);

      })



    })

  </script>
<div class="theme-popover">

     <div class="theme-poptit">

          <a href="javascript:;" title="关闭" class="close">×</a>

          <h3>用户登录</h3>

     </div>

     <div class="theme-popbod dform">

           <form class="theme-signin" name="loginform" action="{{url('/user/tancheckpwd')}}" method="post">
                {!!csrf_field()!!}
                <ol>

                     <li><h4>请先登录</h4></li>

                     <li><input class="ipt" type="text" name="user_name" id="user_name" placeholder="请输入用户名或手机号" ="" size="20" /></li>

                     <li><input class="ipt" type="password" name="user_password" placeholder="请输入密码" size="20" /></li>

                      <li>
                        
                        <input  class="ipt"type="text" name="veryfy" id="veryfy" placeholder="请输入验证码" size="10" />
                        <div style="margin:10px"></div>
                        <span>看不清?点击图片换一张</span>
                        <span><img src="{{url('/verify')}}" id="verifyimg" class="pull-left">
                        </span>

                        <input type="hidden" name="type2" id="type2" value="" id="type2">
                      </li>
                      
                     <div style="margin:30px"></div>
                     <li><input class=" ipt btn btn-primary" type="submit" name="submit" id="sub" value=" 登 录 " /></li>
                     <li>
                       <button type="button" id="regbtn" class="ipt btn btn-default">注册</button>
                     </li>
                      
                </ol>

           </form>

     </div>

</div>

<div class="theme-popover-mask"></div>

<script>

    $(document).ready(function(){
      $('#register').hide();
    });

    //换验证码
    $('#verifyimg').click(function(){
      this.src = "{{url('/verify')}}?id="+Math.random();
    });
    //验证用户名或手机号
    var uname = $('#user_name');
    uname.blur(function(){
      var match = /^1[34578]{1}\d{9}$/;
      if(match.test(uname.val())===true){
        var type2 = 'user_phone';
        $('#type2').val(type2);
      } else {
        var type2 = 'user_name';
        $('#type2').val(type2);
      }
      $.ajax({
        url:'/checktype',
        type:'POST',
        data:{"type":type2,"input":uname.val()},
        async:true,
        success:function(ev){
          if (ev) {
          uname.css("background-color","rgb(169, 240, 180)");
          } else {
          uname.css("background-color","rgb(255, 185, 185)");
          }
        },
        error:function(ev){

        }
      });
    });
    //点击注册跳转到注册页
    $('#regbtn').click(function(){
      window.location.href="{{url('/user/reg')}}";
    });


    $('#sub').click(function(){
      var match = /^1[34578]{1}\d{9}$/;
      if(match.test(uname.val())===true){
        var type2 = 'user_phone';
        $('#type2').val(type2);
      } else {
        var type2 = 'user_name';
        $('#type2').val(type2);
      }
    });
  </script>